<template>
	<view class="page_box">
		<view class="head_box " v-if="0">
			<yy-custom bgColor="bg-gradual-blue">
				<block slot="backText">返回</block>
				<block slot="content">导航栏</block>
			</yy-custom>
		</view>
		<image :src="$IMG_URL" mode="aspectFill" class="pttd" v-if="data.length == 0"></image>
		<view class="content_box">
			<view
				@click="jump(item.user.id)"
				class="head margin-top padding flex  justify-between bg-white"
				v-for="(item, index) in data"
				:key="index"
			>
				<view class="flex">
					<image
						:src="item.user.headimgurl"
						mode="aspectFill"
						style="width: 120rpx; height: 120rpx;"
						class="round "
					></image>
					<view class="flex flex-direction justify-around margin-left">
						<view class="flex  align-center ">
							<text class="f30">{{ item.user.nickname }}</text>
							<view class="flex tt align-center justify-center margin-left-sm">
								<text class="cuIcon-favorfill " style="color: #fbb03b;"></text>
								<text class="f26 text-white">{{ item.user.level }}</text>
							</view>
						</view>
						<text class="text-gray f24">{{ item.user.modifyDt }}</text>
					</view>
				</view>
				<view class="flex">
					<view class="solid-left margin-right"></view>
					<view class="flex flex-direction justify-around align-center">
						<text class="f34 text-black text-bold">{{ item.count }}</text>
						<text class="f24 text-gray">订单总数</text>
					</view>
				</view>
			</view>
		</view>
		<view class="foot_box"></view>
		<!-- 登录提示 -->
		<yy-login v-if="false"></yy-login>
		<!-- 加载提示 -->
		<yy-loading text="加载中.." mask="true" click="true" ref="loading"></yy-loading>
		<!-- 信息提示-->
		<u-toast ref="uToast" />
	</view>
</template>

<script>
import vSwitch from '@/components/v-switch/v-switch';
export default {
	components: {
		vSwitch
	},
	data() {
		return {
			checked: false,
			size: 10,
			current: 1,
			data: [],
			fla: ''
		};
	},
	onShow() {},
	onLoad(e) {
		this.ordrLst();
	},
	onReachBottom() {
		if (this.fla) {
			this.current++;
			this.ordrLst();
		}
	},
	methods: {
		// 平级订单
		async ordrLst() {
			let obj = {
				userId: uni.getStorageSync('data').id,
				size: this.size,
				current: this.current
			};
			const res = await this.$u.get('order/peersList', obj, {});
			if (res.code == 0) {
				res.data.length == 0 ? (this.fla = 0) : (this.fla = 1);
				this.data = [...this.data, ...res.data];
			}

			console.log('res >>  ', res);
		},

		jump(e) {
			uni.navigateTo({
				url: 'parallelOrdrrrr?id=' + e
			});
		},
		toggleMode(status) {
			console.log(status);
		}
	}
};
</script>

<style lang="scss" scoped>
.page_box {
	// width: 100vw;
	// height: 100vh;
	// overflow: scroll;
	background-color: #f7f7f7;
	.content_box {
		.head {
			.tt {
				width: 80rpx;
				height: 30rpx;
				background: linear-gradient(139deg, #393b56, #4f4f62);
				border-radius: 10rpx;
			}
		}
	}
}
</style>
